//
//  DDMessageNotificationCell.m
//  DingDongZP
//
//  Created by 王威 on 16/3/17.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDMessageNotificationCell.h"

@interface DDMessageNotificationCell ()

@property (strong, nonatomic) UIImageView   *iconImageView;
@property (strong, nonatomic) UILabel       *titleLabel;


@end

@implementation DDMessageNotificationCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.iconImageView = [[UIImageView alloc] init];
        self.iconImageView.image = [UIImage imageNamed:@"message_notification"];
        [self.contentView addSubview:_iconImageView];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.text = @"通知";
        self.titleLabel.font = [UIFont systemFontOfSize:13.f];
        [self.contentView addSubview:_titleLabel];
        
        self.notificationLabel = [[UILabel alloc] init];
        self.notificationLabel.textAlignment = NSTextAlignmentLeft;
        self.notificationLabel.text = @"0个人看过您,0个新职位";
        self.notificationLabel.textColor = [UIColor colorWithHexString:@"#ff8125"];
        self.notificationLabel.font = [UIFont systemFontOfSize:13.f];
        [self.contentView addSubview:_notificationLabel];
        
        
        [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(@14.5);
            make.top.mas_equalTo(@8.f);
            make.size.mas_equalTo(CGSizeMake(50.f, 50.f));
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.equalTo(self.iconImageView.mas_right).and.offset(14.f);
            make.top.equalTo(self.iconImageView).and.offset(6.f);
            make.size.mas_equalTo(CGSizeMake(70.f, 18.f));
        }];
        
        [self.notificationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.titleLabel.mas_bottom).and.offset(3.f);
            make.left.equalTo(self.titleLabel);
            make.width.equalTo(self).and.offset(-100);
            make.height.equalTo(self.titleLabel);
        }];
        
//        ESWeakSelf
//        [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
//            ESStrongSelf
//            make.left.mas_equalTo(@14.5);
//            make.top.mas_equalTo(@8.f);
//            make.size.mas_equalTo(CGSizeMake(50.f, 50.f));
//        }];
//        
//        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            ESStrongSelf
//            make.left.equalTo(_self.iconImageView.mas_right).and.offset(14.f);
//            make.top.equalTo(_self.iconImageView).and.offset(6.f);
//            make.size.mas_equalTo(CGSizeMake(70.f, 18.f));
//        }];
//        
//        [self.notificationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            ESStrongSelf
//            make.top.equalTo(_self.titleLabel.mas_bottom).and.offset(3.f);
//            make.left.equalTo(_self.titleLabel);
//            make.width.equalTo(_self).and.offset(-100);
//            make.height.equalTo(_self.titleLabel);
//        }];
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
